package com.geekstudy.week11;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPubSub;

public class RedisDemo {

    public static void main(String[] args) {

        Jedis jedis = new Jedis("127.0.0.1", 6739);
        String channel = "DemoSubPub";
        String message = "Message 202109";
        jedis.publish(channel, message);

        JedisPubSub jedisPubSub = new JedisPubSub() {

        };
        jedis.subscribe(jedisPubSub, channel);
    }
}
